package com.ruoyi.xds.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.xds.domain.XdsAttribute;
import com.ruoyi.xds.mapper.XdsAttributeMapper;
import com.ruoyi.xds.service.IXdsAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 店铺属性Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-01
 */
@Service
public class XdsAttributeServiceImpl implements IXdsAttributeService {
    @Autowired
    private XdsAttributeMapper xdsAttributeMapper;

    /**
     * 查询店铺属性
     *
     * @param id 店铺属性主键
     * @return 店铺属性
     */
    @Override
    public XdsAttribute selectXdsAttributeById(Long id) {
        return xdsAttributeMapper.selectXdsAttributeById(id);
    }

    /**
     * 查询店铺属性列表
     *
     * @param xdsAttribute 店铺属性
     * @return 店铺属性
     */
    @Override
    public List<XdsAttribute> selectXdsAttributeList(XdsAttribute xdsAttribute) {
        return xdsAttributeMapper.selectXdsAttributeList(xdsAttribute);
    }

    /**
     * 新增店铺属性
     *
     * @param xdsAttribute 店铺属性
     * @return 结果
     */
    @Override
    public int insertXdsAttribute(XdsAttribute xdsAttribute) {
        xdsAttribute.setCreateTime(DateUtils.getNowDate());
        return xdsAttributeMapper.insertXdsAttribute(xdsAttribute);
    }

    /**
     * 修改店铺属性
     *
     * @param xdsAttribute 店铺属性
     * @return 结果
     */
    @Override
    public int updateXdsAttribute(XdsAttribute xdsAttribute) {
        xdsAttribute.setUpdateTime(DateUtils.getNowDate());
        return xdsAttributeMapper.updateXdsAttribute(xdsAttribute);
    }

    /**
     * 批量删除店铺属性
     *
     * @param ids 需要删除的店铺属性主键
     * @return 结果
     */
    @Override
    public int deleteXdsAttributeByIds(Long[] ids) {
        return xdsAttributeMapper.deleteXdsAttributeByIds(ids);
    }

    /**
     * 删除店铺属性信息
     *
     * @param id 店铺属性主键
     * @return 结果
     */
    @Override
    public int deleteXdsAttributeById(Long id) {
        return xdsAttributeMapper.deleteXdsAttributeById(id);
    }
}
